const editView = (localData) => {
    let markup = `
<form action="" class="form-horizontal modal-form" role="form" id="form">
    <div class="form-group">
        <label for="config" class="col-xs-2 control-label">配置名:</label>
        <div class="col-xs-9">
            <input type="text" id="config" name="config"  value="{{:config}}" class="form-control">
            <input type="hidden"  name="id" value="{{:id}}">
        </div>
    </div>
  
    <div class="form-group">
        <label for="val" class="col-xs-2 control-label">配置值:</label>
        <div class="col-xs-9">
              {{if type == 2}}
                <div class="uploader" id="uploader">
                    <div id="picker">上传</div>
                    <div class="list"></div>
                    <input type="hidden" id="val"  name="val" class="form-control">
                 </div>
              {{else}}
                    <input type="text" id="val" name="val"  class="form-control" value="{{:val}}">
              {{/if}}
        </div>
    </div>
    <div class="form-group">
        <label for="con_sort" class="col-xs-2 control-label">排序:</label>
        <div class="col-xs-9">
            <input type="text" id="con_sort" placeholder="数值越大越靠前" name="con_sort" value="{{:con_sort}}" class="form-control">
        </div>
    </div>
    <div class="form-group">
        <div class="btn-box">
          <input type="button" class="btn btn-primary" id="submitBtn"  value="提交">
        </div>
    </div>
</form> 
    `;

    let template = $.templates(markup);
    $.views.helpers({
        dataFormat: function (value) {
            return moment(value*1000).format('YYYY-MM-DD');
        }
    });

    let compiledHtml = template.render(localData);

    return compiledHtml;

};

export {
    editView
}